﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using TestSystem.BLL.News;

public partial class Controls_NewsPanel : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["facultyID"] != null)
        {
            int facultyID = int.Parse(Request.QueryString["facultyID"]);
            newsList.DataSource = TestSystem.BLL.News.News.GetByFacultyID(facultyID);
            newsList.DataBind();
            linkAll.NavigateUrl = String.Format(linkAll.NavigateUrl, "facultyID=" + facultyID);
        }
        if (Request.QueryString["facultyID"] == null)
        {
            newsList.DataSource = TestSystem.BLL.News.News.GetForUniversity();
            newsList.DataBind();
            linkAll.NavigateUrl = String.Format(linkAll.NavigateUrl, "mode=university");
        }
    }
}
